﻿using LuShanTea.DTO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LuShanTea.IService
{
    public interface IUserService : IServiceSupport
    {
        long AddNew(UserAddNewDTO userAddNewDTO);

        void Update(UserUpdateDTO userUpdateDTO);

        UserDTO GetByPhoneNum(string phoneNum);

        UserDTO GetById(long userId);

        UserDTO GetByEmail(string email);

        long GetTotalCount();

        UserDTO[] GetAll();

        bool CheckLogin(string account, string pwd);

        bool UpdatePwd(long userId, string oldPwd, string newPwd);

        void MarkDeleted(long userId);

        UserDTO[] GetPageData(int pageSize, int pageIndex);

        UserDTO GetByEmailOrPhoneNum(string email,string phoneNum);

        long GetIdByEmailOrPhoneNum(string email, string phoneNum );

        void RetrievePwd(long userId, string newPwd);
        /// <summary>
        /// 用户登入错误次数++
        /// </summary>
        /// <param name="userId"></param>
        void LockUser(long userId);
        /// <summary>
        /// 对用户解除锁定
        /// </summary>
        /// <param name="userId"></param>
        void UnLockUser(long userId);

        bool CheckIsLock(long userId);
    }
}
